package com.leha.mp.core.builder;

import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutImageMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutNewsMessage;

/**
 * 
 * @author Binary Wang
 *
 */
public class ImageAndContentBuilder extends AbstractBuilder {
  @Override
  public WxMpXmlOutMessage build(String content, WxMpXmlMessage wxMessage) {
    return null;
  }

  @Override
  public WxMpXmlOutMessage build(String desc, String picUrl, String url, String title, WxMpXmlMessage wxMessage) {
    WxMpXmlOutNewsMessage.Item info = new WxMpXmlOutNewsMessage.Item();
    info.setTitle(title);
    info.setPicUrl(picUrl);
    info.setDescription(desc);
    info.setUrl(url);
    WxMpXmlOutNewsMessage m = WxMpXmlOutMessage.NEWS().addArticle(info)
        .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser())
        .build();
    return m;
  }

}
